package com.accloud.cloudservice;

import com.accloud.service.ACDataMgr;
import com.accloud.service.Receiver;
import com.accloud.service.TopicData;

class ACDataManager extends ACAbsDataManager implements ACDataMgr, Receiver<TopicData> {
    private Receiver<TopicData> mDataReceiver;

    ACDataManager() {
        AC.sSockectManager.setCustomDataReceiver(this);
    }

    @Override // com.accloud.service.ACDataMgr
    public void registerDataReceiver(Receiver<TopicData> receiver) {
        this.mDataReceiver = receiver;
    }

    @Override // com.accloud.service.ACDataMgr
    public void unregisterDataReceiver(Receiver<TopicData> receiver) {
        this.mDataReceiver = null;
    }

    public void onReceive(TopicData topicData) {
        topicData.parseTopic();
        if (this.mDataReceiver != null) {
            this.mDataReceiver.onReceive(topicData);
        }
    }
}
